<?php
/**
* 模板固定类数据缓存
* $docArr = self::loadCache('Resume_Class', array("moduleId"=>$moduleId), $num);
* </code>
* @author gemj
* @copyright (c) 2011-04-04
* @version v1.0
* @package Modules
* @subpackage Resume
* @link /index.php?c=CacheTest&a=register&moduleName=Resume_Class 注册
* @link /index.php?c=CacheTest&a=show&moduleName=Resume_Class     显示数据
* @link /index.php?c=CacheTest&a=refresh&moduleName=Resume_Class  刷新模板类数据
*/

class Modules_Resume_Class extends ME_DAL_FileCacheModule
{
	
	protected $_depend = array();

	/**
	* 过期时间
	* @var integer
	*/
	protected $_expire = 3600;

	
	public function refresh(array $param = array())
	{
		$moduleId = empty($param['moduleId']) ? 0 : $param['moduleId'];
               
		if ($moduleId == 0) {
			return false;
		}
                
		$classList = Libs_Admin_Category::getCategoryList(array("module_type"=>$moduleId,"type"=>1));
                
                if(!empty($classList) && is_array($classList)){
                    foreach ($classList as $val){
                        $classid = $val['classid'];
                        $classname = $val['name'];
                        $classArr[$classid] = $classname;
                    }
                }
		$option = array(
                       "moduleId" => $moduleId
                            );
                
		$this->set($option,$classArr);
		return true;
	}
}